<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <!-- 
            单行文本框
         -->
        <p>姓名：{{ name }}</p>
        <input type="text" v-model.lazy.trim="name"> <br>
        <!-- v-model 等同于v-bind和v-on的组合 -->
        <input type="text" :value="name" @input="name=$event.target.value">
        <hr>

        <!-- 
            多行文本框
         -->
        <textarea name="" id="" cols="30" rows="10" v-model.number="age"></textarea>
        <hr>

        <!-- 
            单选按钮
         -->
        <input type="radio" v-model="sex" value="male">男
        <input type="radio" v-model="sex" value="female">女 
        <input type="radio" v-model="sex" value="zhong">中
        <hr>

        <!-- 
            复选框
         -->
        <input type="checkbox" v-model="hobbies" value="eat">吃饭
        <input type="checkbox" v-model="hobbies" value="sleep">睡觉 
        <input type="checkbox" v-model="hobbies" value="doudou">打豆豆
        <hr>

        <!-- 
            对于单一用途的单个复选框，取值一般为boolean，选中为true，未选中为false
         -->
        <input type="checkbox" v-model="flag">同意
        <hr>

        <!-- 
            下拉列表
         -->
        <select v-model="degree">
            <option value="0">--请选择学历--</option>
            <option value="1">大专</option>
            <option value="2">本科</option>
            <option value="3">研究生</option>
        </select>
    </div>
</body>
<script>
    new Vue({
        el:'#app',
        data:{
            name:'tom',
            age:25,
            sex:'male',
            hobbies:['eat','sleep'],
            flag:false,
            degree:'0'
        }
    })
</script>
</html>